﻿import { post, put, get, del } from "@/utils/hettpUtils/httpRequest";

export const userColumns = [
  {
    title: "账号",
    dataIndex: "account",
  },
  {
    title: "账户金额",
    dataIndex: "balance",
    align: "center",
  },
  {
    title: "返现设定",
    dataIndex: "cashbackAmountLimit",
    align: "center",
  },
  {
    title: "消费额设定",
    dataIndex: "consumptionAmountLimit",
    align: "center",
  },
  {
    title: "邮箱",
    dataIndex: "email",
  },
  {
    title: "昵称",
    dataIndex: "nickName",
  },
  {
    title: "手机号",
    dataIndex: "phone",
  },
  {
    title: "微信账户",
    dataIndex: "weChartAccount",
  },
  {
    align: "center",
    title: "收款二维码",
    dataIndex: "wxQrCode",
    scopedSlots: { customRender: "wxQrCode" },
  },
  {
    title: "所属站点",
    dataIndex: "tenantId",
  },
  {
    title: "用户类型", // (普通用户/分销用户)
    dataIndex: "userType",
  },
  {
    title: "分销链接",
    dataIndex: "salesLink",
    scopedSlots: { customRender: "salesLink" },
  },
  {
    align: "center",
    title: "状态",
    dataIndex: "status",
    scopedSlots: { customRender: "status" },
  },
  {
    align: "center",
    title: "操作",
    dataIndex: "action",
    scopedSlots: { customRender: "action" },
  },
];

export const addUser = (parameter) => post("api/user/add", parameter);
export const deleteUser = (parameter) => del("api/user/delete", parameter);
export const updateUser = (parameter) => put("api/user/update", parameter);
export const resetPwd = (parameter) => put("api/user/resetPwd", parameter);
export const changeStatus = (parameter) => put("api/user/changeStatus", parameter);
export const getUser = (parameter) => get("api/user/get", parameter);
export const queryUserList = (parameter) => get("api/user/list", parameter);
export const queryUserPage = (parameter) => post("api/user/pages", parameter);
